using System;
using System.Collections.Generic;
using System.Text;

namespace FrameworkX.ObjectSpace.Validation
{
    public class NotEmptyAttribute : ValidationAttribute
    {
        public override ValidationResult Validate(string propertyName, string value)
        {
            if (string.Empty.Equals(value))
            {
                return new ValidationResult(false,
                    string.Format("{0} cannot be blank.",
                    Util.GetSpacedStringFromWordCapitalizedString(propertyName)));
            }
            else
            {
                return new ValidationResult(true);
            }
        }
    }
}
